package net.zjitc.service.impl;

import net.zjitc.dao.CartItemDao;
import net.zjitc.dao.impl.CartItemDaoImpl;
import net.zjitc.domain.CartItem;
import net.zjitc.domain.User;
import net.zjitc.service.CartItemService;

import java.sql.SQLException;
import java.util.List;

/**
 * 2 * @Author: 洪瑶
 * 3 * @Date: 2018/11/22 9:07
 * 4
 */
public class CartItemServiceImpl implements CartItemService{
    CartItemDao dao = new CartItemDaoImpl();

    @Override
    public List<CartItem> findByuid(int uid) throws Exception {
        return dao.findByuid(uid);
    }

    @Override
    public void addCart(CartItem cartItem) throws SQLException {
         dao.addCart(cartItem);
    }

    @Override
    public CartItem findById(int uid, int pid) throws SQLException {
        return dao.findById(uid,pid);
    }

    @Override
    public void update(CartItem cartItem) throws SQLException {
        dao.update(cartItem);
    }

    @Override
    public void delete(int cartid) throws SQLException {
        dao.delete(cartid);
    }

    @Override
    public void deleteAll(int uid) throws SQLException {
        dao.deleteAll(uid);
    }
}
